const fs = require('fs');
const zlib = require('zlib');

fs.writeFileSync('log.txt', 'gp18');

fs.createReadStream('log.txt')
  .pipe(zlib.createGzip())
  .pipe(fs.createWriteStream('log.txt.gzip'));

